<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改调货处理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-deptProductCargoReply-edit" th:object="${webDeptProductCargoReply}">
            <input name="id" th:field="*{id}" type="hidden">
            <input name="cargoId" th:field="*{cargoId}" type="hidden">
            <input name="productId" th:field="*{productId}" type="hidden">
            <input name="selectProductId"  id="selectProductId" th:field="*{selectProductId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">调货发起方：</label>
                <div class="col-sm-8 form-control-static" th:text="*{deptSourceName}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">申请调货商品名：</label>
                <div class="col-sm-8 form-control-static" th:text="*{productName}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">申请调货数量：</label>
                <div class="col-sm-8 form-control-static" th:text="*{number}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">调货商品：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <input class="form-control" type="text" th:field="*{selectProductName}" name="selectProductName" onclick="selectDeptProduct()" id="selectProductName" required>
                        <span class="input-group-addon"><i class="fa fa-search"></i></span>
                    </div>
                </div>
            </div>

        </form>
    </div>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()" th:if="${webDeptProductCargoReply.status=='0'}"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/deptProductCargoReply";
        $("#form-deptProductCargoReply-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-deptProductCargoReply-edit').serialize());
            }
        }

        function selectDeptProduct(){
            var url = ctx + "system/DeptProduct?type=2";
			$.modal.open("选择商品", url,'1000');
        }
        function doSubmitHandler(id,name){
            $("#selectProductId").val(id);
            $("#selectProductName").val(name);
        }
    </script>
</body>
</html>